<?php
class m_member extends CI_Model{
    function __construct()
    {
        parent::__construct();
    }
    function addmember(){
        $data=array(
         'username'=> $this->security->xss_clean($this->input->post('uname')),
         'password'=> $this->security->xss_clean($this->input->post('upass')),
         'usertype'=> $this->security->xss_clean($this->input->post('utype'))
        );
         $this->db->insert('member', $data);
		 $this->db->close();
    }
    function listmember(){
		$result = $this->db->get('member');
		return $result;
    }
    function deletemember($userid){
		$this->db->where('userid',$userid);
		$data=$this->db->delete('member');
		return $data;
	}
    function updatemember($userid){
        $data=array(
         'username'=> $this->security->xss_clean($this->input->post('uname')),
         'password'=> $this->security->xss_clean($this->input->post('upass')),
         'usertype'=> $this->security->xss_clean($this->input->post('utype'))
        );
		$this->db->where('userid',$userid);
		$data=$this->db->update('member',$data);
		return $data;
	}
}
?>